package com.android.webframework;

public class Parameter
{
	private PHashtable ptable;
	
	/**
	 * Constructs a Parameter by setting a new PHashtable
	 */
	public Parameter()
	{
		setPtable(new PHashtable());
	}
	
	/**
	 * Gets a PHashtable
	 * @return the PHashtable of this object
	 * @see PHashtable
	 */
	public PHashtable getPtable()
	{
		return ptable;
	}
	
	/**
	 * Sets this object's PHashtable
	 * @param ptable a PHashtable 
	 */
	public void setPtable(PHashtable ptable)
	{
		this.ptable = ptable;
	}
	
	/**
	 * Inserts a key value pair into a PHashtable 
	 * @param  key  a key for the hashing function
	 * @param  value the value to where the key maps
	 */
	public void insert(Object key, Object value)
	{
		ptable.insert(key, value);
	}
	
	/**
	 * Returns a value from a PHashtable 
	 * @param  key  a key for the hashing function
	 * @param  value the value to where the key maps
	 * @return the value from where the key mapped
	 * @see Object
	 */
	public Object get(Object key) throws ObjectNotFoundException
	{
		if(ptable.get(key) == null)
			throw new ObjectNotFoundException();
		else
			return ptable.get(key);
	}
}
